import React, { Component } from 'react'
import {
    observer,
    inject
} from 'mobx-react'

@inject('appState') @observer
class TopicDetail extends Component {
    changeName= (e) =>{
        this.props.appState.changeName(e.target.value)
    }
    render() {
        return(
            <div>
                <h3>this is topic detail22</h3>
                <input type="text" onChange={this.changeName}/>
                <p>{this.props.appState.msg}</p>
                <button onClick={this.props.appState.add}>add</button>
            </div>
        )
    }
}

export default TopicDetail